package com.iplant.base.po;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;

import static com.iplant.base.utils.annotation.condition.DBCondition.DBCompareType;

/**
 * @author xiuto
 */
@DBBasePO(TableName = "mbs_api_map", Code = false, CheckName = {"Uri,ProjectName"},Schemas = DBSchemas.Basic)
public class RequestMappingAPI extends BasePO {

    @DBCondition
    @DBField(length = 45)
    public String ProjectName = "";
    @DBCondition
    @DBField(length = 128)
    public String Uri = "";

    @DBCondition
    @DBField(length = 10)
    public String Method = "GET";

    @DBField(length = 45)
    public String ControllerName = "";

    @DBField(length = 128)
    public String FullName = "";

    /**
     * 默认低于0毫秒不记录
     */
    @DBField
    public int AlarmLogMin = 0;

    /**
     * 日志消息内容
     */
    @DBField(length = 128)
    public String Pattern = "";


    /**
     * 模块名称
     */

    @DBCondition(CompareType = DBCompareType.like)
    @DBField(length = 45)
    public String ModuleName = "";

    /**
     * 成功也存储日志
     */
    @DBCondition
    @DBField
    public int SuccessEnable=1;


    /**
     * 打印全部日志
     */
    @DBField
    public int PrintLimit=200;

    @JsonProperty("ProjectName")
    public String getProjectName() {
        return ProjectName;
    }

    public void setProjectName(String projectName) {
        ProjectName = projectName;
    }

    @JsonProperty("Uri")
    public String getUri() {
        return Uri;
    }

    public void setUri(String uri) {
        Uri = uri;
    }

    @JsonProperty("Method")
    public String getMethod() {
        return Method;
    }

    public void setMethod(String method) {
        Method = method;
    }

    @JsonProperty("ControllerName")
    public String getControllerName() {
        return ControllerName;
    }

    public void setControllerName(String controllerName) {
        ControllerName = controllerName;
    }

    @JsonProperty("FullName")
    public String getFullName() {
        return FullName;
    }

    public void setFullName(String fullName) {
        FullName = fullName;
    }

    @JsonProperty("Pattern")
    public String getPattern() {
        return Pattern;
    }

    public void setPattern(String pattern) {
        Pattern = pattern;
    }
    @JsonProperty("AlarmLogMin")
    public int getAlarmLogMin() {
        return AlarmLogMin;
    }

    public void setAlarmLogMin(int alarmLogMin) {
        AlarmLogMin = alarmLogMin;
    }
    @JsonProperty("ModuleName")
    public String getModuleName() {
        return ModuleName;
    }

    public void setModuleName(String moduleName) {
        ModuleName = moduleName;
    }

    @JsonProperty("SuccessEnable")
    public int getSuccessEnable() {
        return SuccessEnable;
    }

    public void setSuccessEnable(int successEnable) {
        SuccessEnable = successEnable;
    }

    @JsonProperty("PrintLimit")
    public int getPrintLimit() {
        return PrintLimit;
    }

    public void setPrintLimit(int printLimit) {
        PrintLimit = printLimit;
    }
}
